<?php
    $arrHotQuestion = $this->host_question;
    //var_dump($arrHotQuestion);
    $arrOpenQuestion = $this->open_question;
    $arrEventQuestion = $this->event_question;
?><head>
    <title></title>
<style type="text/css">
    body{color: #000000}
    #Button2
    {
        height: 25px;
        width: 149px;
    }

    #Button3
    {
        height: 25px;
        width: 149px;
    }
</style>
<script>
    var temp;
    function showTable(a) {
        document.getElementById(a).style.display = "";


    }
    function hideTable(a) {
        document.getElementById(a).style.display = "none";
        //document.getElementById(a).setAttribute("size", 0);
    }
    function Button1_onclick() {

    }

</script>
</head>

<tr>
    <td valign="top">
        <table style="width:100%;">
            <tr>
                <td>
                    <table style="width:100%;">
                        <tr>
                <td>
                    <a href="Homepage.htm">
                    Trang chủ</a> > <a href="CategoryList.htm">Các chủ đề</a> &gt; Lớp 9</td>
                <td align="right">&nbsp;
                                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    Chủ đề con: <a href="">Toán</a>, <a href="">Lý</a>, <a href="">Hóa</a>, <a href="">Sinh</a>, <a href="">Anh</a></td>
            </tr>
            <tr>
                <td>
                                <table style="width:100%;">
                                    <tr>
                                        <td style="width:50%">
                                <table  frame="border" style="width:100%;">
                                    <tr>
                                        <td bgcolor="Silver">
                                            <strong>Câu hỏi HOT trong tuần</strong></td>
                                    </tr>
                                    <tr>
                                        <td>
                                <table style="width:100%;">
                                    <?php
                                        foreach($arrHotQuestion as $value) :
                                            $timeCreate = date('Y-m-d', strtotime($value['date_ask']));
                                            //$timeUpdate = date('Y-m-d', strtotime($value['udpate_time']));
                                            //$now = date('Y-m-d');
                                    ?>
                                    <tr>
                                        <td>
                                            <a href="Homepage.htm"><strong><?=$value['quest_title'];?></strong></a>
                                            [Toán 9]<em style="font-size: small" title="Ngày tạo"><?=$timeCreate?></em>&nbsp;</td>
                                    </tr>
                                    <?php
                                        endforeach;
                                    ?>
                                    <tr>
                                        <td align="right">
                                            <a href="QuestionHotList.htm" title="">More</a></td>
                                    </tr>
                                    </table>
                                        </td>
                                    </tr>
                                </table>
                                        </td>
                                        <td>
                                <table  frame="border" style="width:100%;">
                                    <tr>
                                        <td bgcolor="Silver">
                                            <strong>Câu hỏi đang mở</strong></td>
                                    </tr>
                                    <tr>
                                        <td>
                                <table style="width:100%;">
                                    <?php
                                        foreach($arrOpenQuestion as $value) :
                                            $timeCreate = date('Y-m-d', strtotime($value['date_ask']));
                                            //$timeUpdate = date('Y-m-d', strtotime($value['udpate_time']));
                                            //$now = date('Y-m-d');
                                    ?>
                                    <tr>
                                        <td>
                                            <a href="Homepage.htm"><strong><?=$value['quest_title'];?></strong></a>
                                            [Toán 9]<em style="font-size: small" title="Ngày tạo"><?=$timeCreate?></em>&nbsp;</td>
                                    </tr>
                                    <?php
                                        endforeach;
                                    ?>
                                    <tr>
                                        <td align="right">
                                            <a href="QuestionOpenList.htm" title="[Open search question]">More</a></td>
                                    </tr>
                                    </table>
                                        </td>
                                    </tr>
                                </table>
                                        </td>
                                    </tr>
                                </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table style="width:100%;" frame="border">
                        <tr>
                            <td bgcolor="Silver">
                                <strong>
                                            <a href="#" title="[Display when something new, when they click they display inline the latest updates]">
                                            Có cập nhật mới**</a>*</strong></td>
                        </tr>
                        <tr>
                            <td bgcolor="Silver">
                                <strong>Lớp 9</strong></td>
                        </tr>
                        <?php
                            foreach($arrEventQuestion as $value) :
                                $timeCreate = date('Y-m-d', strtotime($value['date_ask']));
                                
                        ?>
                        <tr>
                            <td>
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                            <em style="font-style:italic; font-size:small">Câu hỏi mới thêm vào [Toán 9], 6 phút trước<br />
                                <img src="in_icon.png"
                                    style="height: 15px; width:15px" alt="[Theo câu hỏi]" title="Theo câu hỏi" />
                                <img src="star_icon.jpg"
                                    style="height: 15px; width:15px" alt="[Gắn sao câu hỏi]" title="Gắn sao câu hỏi" />
                                            </em>
                                            <strong>
                                            <a href="QuestionView.htm" style="font-size:large">
                                            <?=$value['quest_title']?></a></strong>
                                            [Toán 9]<img src="question_mark.red.gif"
                                                style="height: 15px; width: 15px" /><em style="font-size: small" title="Ngày tạo"><?=$timeCreate?></em><br />
                                            <?=$value['quest_title']?>...
                                            <a href="Homepage.htm"><em title="[Open inline more]">more</em></a> <img title="Hay" src="good_icon.jpg"
                                                style="height: 20px; width: 20px" />&nbsp; <img title="Kém" src="bad_icon.jpg"
                                                style="height: 20px; width: 20px" /><br />
                                            <em><?=$value['view_num']?> Lượt xem • <?=$value['prize_give']?> điểm • <?=$value['ans_num']?> Trả lời • <?=$value['follow_num']?> Theo dõi <hr style="color: #717171; height: 1px;"></td>
                                    </tr>
                                    </table>
                                        </td>
                                    </tr>                              

                                </table>                                
                            </td>
                        </tr>
                        <?php
                            endforeach;
                        ?>
                        <tr>
                            <td align="right">
                                <strong style="background-color: #C0C0C0" title="Trang 2">Trang 1/15</strong></td>
                        </tr>
                    </table>
                            </td>
            </tr>
        </table>
    </td>
    <td valign="top" style="width:20%">
        <table style="width:100%;">
            <tr>
                <td>
                                <table frame="border" style="width:100%;">
                                    <tr>
                                        <td colspan="3">
                                            <table style="width:100%;">
                                                <tr>
                                        <td bgcolor="Silver" style="font-weight: 700">
                                           <a href="UserList.htm">Chuyên gia                                            </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            1</td>
                                        <td>
                                            <a href="UserViewSpecialist.htm">CG
                                            Trần Văn B</a></td>
                                        <td>
                                            10</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            2</td>
                                        <td>
                                            CG
                                            Nguyễn Việt A</td>
                                        <td>
                                            10</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            3</td>
                                        <td>
                                            CG
                                            Lưu Vũ C</td>
                                        <td>
                                            10</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            4</td>
                                        <td>
                                            CG
                                            Trịnh Tấn D</td>
                                        <td>
                                            10</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            5</td>
                                        <td>
                                            CG
                                            Trịnh Tấn E</td>
                                        <td>
                                            10</td>
                                    </tr>
                                    <tr>
                                        <td align="right" colspan="3">
                                            <a href="UserList.htm">More</a></td>
                                    </tr>
                                    </table>
                            </td>
            </tr>
            <tr>
                <td>
                                <table frame="border" style="width:100%;">
                                    <tr>
                                        <td colspan="3">
                                            <table style="width:100%;">
                                                <tr>
                                        <td bgcolor="Silver" style="font-weight: 700">
                                            Người dùng</td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            1</td>
                                        <td>
                                            Trần Văn B</td>
                                        <td>
                                            +200</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            2</td>
                                        <td>
                                            Nguyễn Việt A</td>
                                        <td>
                                            +190</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            3</td>
                                        <td>
                                            Lưu Vũ C</td>
                                        <td>
                                            +150</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            4</td>
                                        <td>
                                            Trịnh Tấn D</td>
                                        <td>
                                            +120</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            5</td>
                                        <td>
                                            Trịnh Tấn E</td>
                                        <td>
                                            +90</td>
                                    </tr>
                                    </table>
                            </td>
            </tr>
            <tr>
                <td>&nbsp;
                                </td>
            </tr>
            <tr>
                <td>&nbsp;
                    </td>
            </tr>
        </table>
    </td>
</tr>
